#!/bin/sh

mount -t proc proc /proc
mount -t sysfs sysfs /sys
# mke2fs -T ext4 /dev/vda
# mount -t ext4 /dev/vda /vioblk

# mount -t ext4 /dev/sdb /scsib
# cp /proc/vmcore /scsib/vmcore

ifconfig eth0 up
ifconfig lo 127.0.0.1

udhcpc -i eth0 -b -R
# ifconfig eth0 down
# ifconfig eth0 up

# cgroup
mount -t tmpfs tmpfs /sys/fs/cgroup
# cpu,cpuacct
mkdir /sys/fs/cgroup/cpu,cpuacct
mount -t cgroup -o cpu,cpuacct cgroup /sys/fs/cgroup/cpu,cpuacct
ln -sf /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpu
ln -sf /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct

# install crash kernel
kexec -p /usr/local/bzImage --append="root=/dev/vda rw 1 irqpoll maxcpus=1 reset_devices console=ttyS0 hpet=disable"
